window.onload=function(){
    layui.use(['jquery','layer'],function(){
        var $ = layui.jquery;

        $(".label-pic").on("click",function(){
            var src = $(this).next(".p40").find('img').attr("src");
            var str = '<img src="'+src+'" style="display:block;margin:25px auto;width:750px;height:400px;"/>'
            Utils.layer.open({
                type: 1,
                title: false,
                content: str,
                area:['850px','450px'],
                closeBtn: 2,
            })
        })

        var hf=window.location.href.split("?");
        var hf2=hf[1].split("&");
        var hf3=hf2[1];
        var id=hf2[0].split("=")[1];
        if(hf3!=undefined){
            $(".a1").attr("href","/shop/get-info?id="+id+"&type=1");
            $(".a2").attr("href","/shop/goods-index?id="+id+"&type=1");
            $(".a3").attr("href","/shop/activity?id="+id+"&type=1");
        }else{
            $(".a1").attr("href","/shop/get-info?id="+id);
            $(".a2").attr("href","/shop/goods-index?id="+id);
            $(".a3").attr("href","/shop/activity?id="+id);
        }
        
        $('.back').on("click",function(){
            if(hf3!=undefined){
                this.href="/shop-user/index";
            }else{
                this.href="/shop/index";
            }
        })
    });
};